package com.test.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import redis.clients.jedis.Jedis;

@RestController
public class RedisController {
	
	@Autowired
	private Jedis jedis;
	
	@RequestMapping("/redis/{name}")
	public String redis(@PathVariable("name") String name) {
		jedis.set("name", name);
		return jedis.get("name");
	}
}
